package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * <p>
 * 历史数据表
 * </p>
 *
 * @author HuangLu
 * @since 2019-01-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class BarHistory extends Model<BarHistory> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "data_id", type = IdType.AUTO)
    private Long dataId;

 /**
     * 设备id
     */
    private Long devId;

    /**
     * sim卡号
     */
    private String sim;

    /**
     * 上报时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime dataTime;

    /**
     * 纬度
     */
    private String lat;

    /**
     * 经度
     */
    private String lng;

    /**
     * 电池
     */
    private String battery;
    /**
     * 偏移量
     */
    private String shift;
    /**
     * 信号
     */
    private String signalStrength;

    private Integer positioningState;

    private String high;
    /**
     * 插入时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;


    /**
     * 是否报警
     */
    private Boolean isAlarm;

    /**
     * 数据类型1位置，2电量信号，3报警
     */
    private Integer dataType;
    /**
	 * 部门名称
	 */
    @TableField(exist = false)
	private String depName;

	/**
	 * 部门级联id
	 */
    @TableField(exist = false)
    private String depCascader;

    @TableField(exist = false)
    private String imei;

    @TableField(exist = false)
    private String installCode;


    @Override
    protected Serializable pkVal() {
        return this.dataId;
    }

    @Override
    public String toString() {
        return "BarHistory{" +
        "dataId=" + dataId +
        ",devId=" + devId +
        ", sim=" + sim +
        ", dataTime=" + dataTime +
        ", dataType=" + dataType +
        ", isAlarm=" + isAlarm +
        ", lat=" + lat +
        ", lng=" + lng +
        ", battery=" + battery +
        ", signalStrength=" + signalStrength +
        ", createTime=" + createTime +
        "}";
    }
}
